package com.huabo.system.service.impl;

import com.hbfk.util.PageInfo;
import com.huabo.system.mysql.entity.TblAssessTargetMySql;
import com.huabo.system.mysql.mapper.TblAssessTargetMySqlMapper;
import com.huabo.system.oracle.entity.TblAssessTarget;
import com.huabo.system.oracle.mapper.TblAssessTargetMapper;
import com.huabo.system.service.TblAssessTargetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Service
public class TblAssessTargetServiceImpl implements TblAssessTargetService {

    @Resource
    private TblAssessTargetMapper tblAssessTargetMapper;

    @Resource
    private TblAssessTargetMySqlMapper tblAssessTargetMySqlMapper;

    @Override
    public void MyMark(BigDecimal staffid, String assid, String assName, PageInfo<TblAssessTarget> pageInfo) {
        Map<String, Object> resultMap = new HashMap<String, Object>(0);
        pageInfo.setTlist(tblAssessTargetMapper.MyMark(staffid, assid, assName, pageInfo));
        pageInfo.setTotalRecord(tblAssessTargetMapper.MyMarkCount(staffid, assid, assName));
        resultMap.put("data", pageInfo);
        resultMap.put("code", "1");
        resultMap.put("msg", "访问接口成功");
    }

    @Override
    public void MySqlMyMark(BigDecimal staffid, String assid, String assName, PageInfo<TblAssessTargetMySql> mySqlpageInfo) {
        Map<String, Object> resultMap = new HashMap<String, Object>(0);
        mySqlpageInfo.setTlist(tblAssessTargetMySqlMapper.MyMark(staffid, assid, assName, mySqlpageInfo));
        mySqlpageInfo.setTotalRecord(tblAssessTargetMySqlMapper.MyMarkCount(staffid, assid, assName));
        resultMap.put("data", mySqlpageInfo);
        resultMap.put("code", "1");
        resultMap.put("msg", "访问接口成功");
    }
}
